<?php echo $header; ?>
<div class="page">
	<div class="personal_info">
    	Welcome,<span id="userName"><?php echo $this->customer->getLastName() ?></span>
					<a href="index.php?route=account/logout">logout</a>
    </div>
	<div class="greenPanel">
		<table width="95%" cellpadding="0" cellspacing="0" align="center" style="margin:auto;">
			<tr>
				<td colspan="3" align="left" height="50px">
					<a href="javascript:void(0)" style="float:left;background:url(catalog/view/theme/default/images/agreeItem.png);padding:8px 70px 17px 62px;">Account</a>
				</td>
			</tr>
			<tr>
				<?php echo $left; ?>
				<td style="height:500px;" valign="top" class="ManageMain">
					<ul>
						<li>Product Returns</li>
					</ul>
					  <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
						<table width="100%" cellspacing="0" cellpadding="0" class="list" style="display: table">
							<tr>
							<th class="textleft">Order Information</th>
							<th width="80%" class="textleft">&nbsp;</th>
							</tr>
							<tr>
							<td class="textright"><font class="word-red">*</font>First Name:</td>
							<td class="textleft"><input type="text" name="firstname" value="<?php echo $firstname; ?>" class="large-field" />
							<br />
							<?php if ($error_firstname) { ?>
							<span class="error"><?php echo $error_firstname; ?></span>
							<?php } ?></td>
							</tr>
							<tr>
							<td class="textright"><font class="word-red">*</font>Last Name:</td>
							<td class="textleft"><input type="text" name="lastname" value="<?php echo $lastname; ?>" class="large-field" /><br />
							<?php if ($error_lastname) { ?>
							<span class="error"><?php echo $error_lastname; ?></span>
							<?php } ?></td>
							</tr>
							<tr>
							<td class="textright"><font class="word-red">*</font>E-Mail:</td>
							<td class="textleft"><input type="text" name="email" value="<?php echo $email; ?>" class="large-field" />
							<br />
							<?php if ($error_email) { ?>
							<span class="error"><?php echo $error_email; ?></span>
							<?php } ?></td>
							</tr>
							<tr>
							<td class="textright"><font class="word-red">*</font>Telephone:</td>
							<td class="textleft"><input type="text" name="telephone" value="<?php echo $telephone; ?>" class="large-field" />
							<br />
							<?php if ($error_telephone) { ?>
							<span class="error"><?php echo $error_telephone; ?></span>
							<?php } ?></td>
							</tr>
							<tr>
							<td class="textright"><font class="word-red">*</font>Order ID:</td>
							<td class="textleft"><input type="text" name="order_id" value="<?php echo $order_id; ?>" class="large-field" />
							<br />
							<?php if ($error_order_id) { ?>
							<span class="error"><?php echo $error_order_id; ?></span>
							<?php } ?></td>
							</tr>
							<tr>
							<td class="textright"><font class="word-red">*</font>Order Date:</td>
							<td class="textleft"><input type="text" name="date_ordered" value="<?php echo $date_ordered; ?>" class="large-field date" /></td>
							</tr>
						</table>
						<table width="100%" cellspacing="0" cellpadding="0" class="list" style="display: table">
							<tr>
							<th colspan="2" class="textleft">Product Information & Reason for Return</th>
							</tr>
							<tr>
							<td class="textright" width="30%"><font class="word-red">*</font>Product Name:</td>
							<td class="textleft"><input type="text" name="product" value="<?php echo $product; ?>" />
							    <br />
							    <?php if ($error_product) { ?>
							    <span class="error"><?php echo $error_product; ?></span>
							    <?php } ?></td>
							</tr>
							<tr>
							<td class="textright"><font class="word-red">*</font>Product Model:</td>
							<td class="textleft"><input type="text" name="model" value="<?php echo $model; ?>" />
							    <br />
							    <?php if ($error_model) { ?>
							    <span class="error"><?php echo $error_model; ?></span>
							    <?php } ?></td>
							</tr>
							<tr>
							<td class="textright">Quantity:</td>
							<td class="textleft"><input type="text" name="quantity" value="<?php echo $quantity; ?>" /></td>
							</tr>
							<tr>
							<td class="textright"><font class="word-red">*</font>Reason for Return:</td>
							<td class="textleft">
								<?php foreach ($return_reasons as $return_reason) { ?>
									<?php if ($return_reason['return_reason_id'] == $return_reason_id) { ?>
									<p>
										<input type="radio" name="return_reason_id" value="<?php echo $return_reason['return_reason_id']; ?>" id="return-reason-id<?php echo $return_reason['return_reason_id']; ?>" checked="checked" />
										<label for="return-reason-id<?php echo $return_reason['return_reason_id']; ?>"><?php echo $return_reason['name']; ?></label>
									</p>
									<?php } else { ?>
									<p>
										<input type="radio" name="return_reason_id" value="<?php echo $return_reason['return_reason_id']; ?>" id="return-reason-id<?php echo $return_reason['return_reason_id']; ?>" />
										<label for="return-reason-id<?php echo $return_reason['return_reason_id']; ?>"><?php echo $return_reason['name']; ?></label>
									</p>
									<?php  } ?>
								<?php  } ?>
								<?php if ($error_reason) { ?><br>
							    <span class="error"><?php echo $error_reason; ?></span>
							    <?php } ?>
							</td>
							</tr>
							<tr>
							<td class="textright">Product is opened:</td>
							<td class="textleft"><p>
								<?php if ($opened) { ?>
							    <input type="radio" name="opened" value="1" id="opened" checked="checked" />
							    <?php } else { ?>
							    <input type="radio" name="opened" value="1" id="opened" />
							    <?php } ?>
							    <label for="opened"><?php echo $text_yes; ?></label>
							    <?php if (!$opened) { ?>
							    <input type="radio" name="opened" value="0" id="unopened" checked="checked" />
							    <?php } else { ?>
							    <input type="radio" name="opened" value="0" id="unopened" />
							    <?php } ?>
							    <label for="unopened"><?php echo $text_no; ?></label></p></td>
							</tr>
							<tr>
							<td class="textright">Faulty or other details:</td>
							<td class="textleft"><textarea name="comment" cols="60" rows="6"><?php echo $comment; ?></textarea></textarea></td>
							</tr>
							<tr>
								<td class="textright">Enter the code in the box below:</td>
								<td class="textleft"><input type="text" name="captcha" value="<?php echo $captcha; ?>" />
							    <br />
							    <img src="index.php?route=account/return/captcha" alt="" />
							    <?php if ($error_captcha) { ?>
							    <span class="error"><?php echo $error_captcha; ?></span>
							    <?php } ?></td>
							</tr>
							<tr>
								<td class="textright">&nbsp;</td>
								<td class="textleft">
								<label>
								<input name="button" type="submit" class="submit_button" id="button" value="submit" />
								</label>
								</td>
							</tr>
						</table>
					  </form>
				</td>
			</tr>
		</table>
	</div>
</div>
<script type="text/javascript"><!--
$(document).ready(function() {
	$('.date').datepicker({dateFormat: 'yy-mm-dd'});
});
//--></script> 
<?php echo $footer; ?> 
